package com.zhaishuaishuai.serviceCaller.controller;

import com.zhaishuaishuai.serviceCaller.feignClient.ServiceProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller("SeriveCallerController")
public class SeriveCallerController {

    @Resource
    private ServiceProviderFeign serviceProviderFeign;
    //用于测试@feign，服务之间的调用
    @RequestMapping("/sayHello")
    @ResponseBody
    public String sayHello(){
        return  serviceProviderFeign.sayHello();
    }
    //用于测试网关是否走通
    @RequestMapping("/useZuul")
    @ResponseBody
    public String useZuul(){
        return "from service caller";
    }
}
